<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-12-22 14:21:05
 * @LastEditors: swc
 * @LastEditTime: 2024-06-18 14:22:41
-->

<template>
  <span :class="{ 'read-only': renderOpts.props.disabled }">{{
    isI18n
      ? $srv.getI18nBySrv(params.row[params.column.field])
      : params.row[params.column.field]
  }}</span>
</template>

<script lang="ts">
import { Tsrv, T_srv, ifs, ts, vue } from '@/services';

@T_srv.comp
export default class oM2oCell extends vue {
  /* 组件名 */
  private name: string = 'oM2oCell';

  private isI18n: boolean = false;

  private Tcommand: any = null;

  @T_srv.prop({ required: true }) params: any;

  @T_srv.prop({ required: true }) renderOpts: any;

  created() {
    if (typeof this.renderOpts.props?.getTcommand === 'function') {
      this.Tcommand = this.renderOpts.props.getTcommand();
      if (typeof this.Tcommand?.isI18nField === 'function') {
        this.isI18n = this.Tcommand.isI18nField(this.params.column.property);
      }
    }
  }

  mounted() {}
}
</script>
<style lang="scss" scoped></style>
